(function(vc){
    vc.extends({
        propTypes: {
           emitChooseFloor:vc.propTypes.string,
           emitLoadData:vc.propTypes.string
        },
        data:{
            records: [],
            mid: ''
        },
        _initMethod:function(){

        },
        _initEvent:function(){
            vc.on('searchFloor','openSearchFloorModel',function(_param){
                $('#searchFloorModel').modal('show');
                vc.component._loadAllFloorInfo(1,10,_param);
            });
        },
        methods:{
            _loadAllFloorInfo:function(_page,_rows,_mid){
                var param = {
                    params:{
                        page: _page,
                        row: _rows,
                        mid: _mid
                    }
                };
                //发送get请求
               vc.http.get('we.record.list','',param,
                             function(json){
                                var _floorInfo = JSON.parse(json);
                                vc.component.records = _floorInfo.data;
                                vc.emit('pagination', 'init', {
                                    total: _floorInfo.records,
                                    currentPage: _page
                                });
                             },function(){
                                console.log('请求失败处理');
                             }
                           );
            },
            chooseFloor:function(_floor){
                vc.emit($props.emitChooseFloor,'chooseFloor',_floor);
                vc.emit($props.emitLoadData,'loadData',{
                    floorId:_floor.floorId
                });
                $('#searchFloorModel').modal('hide');
            }
        }
    });
})(window.vc);